#encoding:utf-8

from pojo.entity.BaseEntity import BaseEntity

class Fund(BaseEntity):
    id=None
    realTransactionId=None
    tradeDate = None

    account=None #资产账户
    balance=None #资金余额
    available=None #可用余额
    marketVal=None #市值
    tradeFrozen=None #交易冻结金额
    totalProfit=None #总盈亏

    entryTime = None  # 更新时间  yyyy-MM-dd HH:mm:ss:SSS

    def changeFormat(self):
        self.available=float(self.available)
        self.tradeFrozen=float(self.tradeFrozen)
        return self


    def getTableName(self):
        pass

    def getTableFieldMap(self):
        pass

    def __str__(self):
        descDict=self.__dict__
        return """Fund-----{desc}""".format(
            desc=",".join(["{key}:{val}".format(key=key,val=val.encode("utf-8") if isinstance(val,unicode) else val ) for key,val in descDict.items()])
        )